package com.xhdx;
import cfca.mobile.BOCServerDecryption;
import cfca.mobile.Base64;
public class TestMima {
    public static void main(String args[]){
        String pfxpath = "D:/key/sslwebserver.pfx";// 私钥
        //加密客户端随机数
        String clientRandom="BSetorgyyDuxzU03xoA3xrrLvhsR00fEu233cACFKzBGpP8wwiD3FOT/u4tAJqJzH4DlQWTPhwOVZ8iHOieaga48quSAy7NxuvEgFRuxjGcRDzGzyGES5Uh75VSP0g6HqBHkUhf4kwYX9TTdOENPXFX9Zv9JSk+YLGIQa/JE8qLE+FU6nqHyZcIOzuFvL8URWdVXWJJHFZAv66U5gYRoKGpSrNofRsWYjAER/Bs0NsueF94zRblAzK60M6Xkbvav59VU+TL/u74Ub5CaFx19y+Y58tbT4XQADbLoi6ZTPl+coA+AwQY+POGzG4wXwsx3tICNknAWDnWYgTMSOmy+XQ==";

        String privateKeyFilePsd = "hnnx65200599";
        String encPwd = "ashVV6TZFRs=";//加密输入数据
        String serverRandom = new String(Base64.encode("2018081319123456".getBytes()));
        System.out.println(serverRandom);
            
        BOCServerDecryption bOCServerDecryption = new BOCServerDecryption();
        String path = pfxpath;//Thread.currentThread().getContextClassLoader().getResource(privateKeyFile).getPath();
        System.out.println(String.format("privateKeyFile%sqq, privateKeyFilePsd[%s]", path, privateKeyFilePsd));

        try {
            String[] args1={ path, privateKeyFilePsd, clientRandom, serverRandom, encPwd, "1"};
            String str = bOCServerDecryption.decrypt(args1);
            System.out.println(str);
          } catch (Exception e){
             // TODO Auto-generated catch block
             e.printStackTrace();
        }

     } 

}
